<template>
  <div class="container">
    <div class="content">
      <div class="content-group" v-for="(item, index) in list" :key="index">
        <div class="content-group-item-avatar">
          <image src="https://img.yzcdn.cn/vant/cat.jpeg" />
        </div>
        <div class="content-group-box">
          <div class="content-group-item">
            {{ item.name }}
          </div>
          <div class="content-group-item cv-flex">
            <div class="cost">￥{{ item.cost }}</div>
            <uni-tag text="去预约" type="primary" @click="goDetailPage(item)" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  computed: {
    list() {
      return Array(3).fill({
        name: "新生体检",
        cost: "200",
      });
    },
  },
  methods: {
    // 跳转 套餐详细 页面
    goDetailPage(item) {
      uni.navigateTo({
        url: `/pages/detail/index?packageId=${item.id}`,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  border-radius: 8px;
  margin-bottom: 1rem;
}

.content-group {
  border-radius: 8px;
  margin: 0.625rem;
  border: 1px solid #ebeef5;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 rgba(151, 203, 245, 0.5);
  display: flex;
}
.content-group-box {
  // border: 1px solid red;
  width: 65vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.content-group-item-avatar {
  width: 12vh;
  height: 12vh;
  padding: 10px;
  border-radius: 6px;
}
.content-group-item-avatar image {
  height: 100%;
  width: 100%;
  border-radius: 6px;
}
.content-group-item {
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
}
.view-qr-code {
  height: 30vh;
  width: 30vh;
}
.view-qr-code image {
  height: 100%;
  width: 100%;
}
.cv-flex {
  display: flex;
  justify-content: space-between;
}
.cost {
  color: #ff0000;
  font-weight: bold;
}
</style>